<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .test {
            border: 1px solid red;
        }

        h1 {
            /* width: 25.5px; */
            color: rgb(84, 84, 119);
        }

        h2 {
            color: rgb(82, 82, 128);
        }

        p {
            color: aquamarine;
            font-size: 14px;
        }

        .test2 {
            /* display: flex;
            align-items: flex-start; */
            border: 1px solid gold;
            /* background-color: aqua; */
            padding: 20px;
        }

        canvas {
            margin-top: 40px;
            /* border: 4px solid rebeccapurple; */
        }

        img {
            width: 100px;
        }

        .img {
            width: 100px;
            height: 100px;
            background: url('./cat.jpg') no-repeat;
            background-size: 100% 100%;
            margin-bottom: 50px;
        }

        .bg1 {
            border-radius: 20px;
            width: 360px;
            height: 720px;
        }

        .test11 {
            position: relative;
        }

        .code {
            position: absolute;
            left: 245px;
            top: 600px;
            width: 80px;
            height: 80px;
            background: url('../imgs/cat.jpg') no-repeat;
            background-size: 100% 100%;
        }

        .p22 {
            display: inline-block;
            /* background-color: aquamarine; */
            border: 1px solid red;
            border-radius: 6px;
        }
    </style>
</head>

<body>
    <h1>canvas绘制测试1 图片合成测试 </h1>
    <div class="test">

        <div class="test11">
            <img src="../imgs/BBGS.jpg" class="bg1" alt="" srcset="">
            <div class="code"></div>
        </div>
        <div class="test2">
            <p class="p22">滚滚滚2</p>
            h高分化  广佛模糊ID覅讴歌R级没法地图供热大佛我加个熊二阿热do覅今天刚IE【打个哦啊人人防火规范
        </div>
    </div>
    <h1>canvas绘制</h1>
    <canvas id="canvas"></canvas>
</body>
<script src="../dist/main.js"></script>
<script>
    const root = document.querySelector(".test")

    layout(root, 'canvas')
    let timer;
    window.addEventListener('resize', () => {
        if (timer) { clearTimeout(timer) }
        timer = setTimeout(function () {
            layout(root, 'canvas')

        }, 100);
    })
</script>

</html>